using TMPro;
using UnityEngine;
using Voodoo.Pattern;

public class PrestigePointsCounter : SingletonMB<PrestigePointsCounter>
{
	[SerializeField]
	private TextMeshProUGUI text;

	private int _lastPrestige = -1;

	private void Start()
	{
		UpdateValue();
	}

	public void UpdateValue()
	{
		int num = (int)NintendoPlayerPrefs.GetFloat("PrestigePoints", 0f);
		if (num != _lastPrestige)
		{
			text.text = num.ToString();
		}
		_lastPrestige = num;
	}
	public void GetPrestigePoints(int points)
	{
		AdManager.Instance.ShowVideo(() =>
		{
			NintendoPlayerPrefs.SetFloat("PrestigePoints", NintendoPlayerPrefs.GetFloat("PrestigePoints", 0f) + points);
			UpdateValue();
			Shop.Instance.CheckButtons();
		});
	}
}
